<#include "/jdbc-typescript-type.ftl">
${gen.setFilename("service.ts")}
${gen.setFilepath("${settings.sourcesPath}/ui/${entity.name}/Ant-Design-Pro")}
import request from '@/utils/request';
import { ${entity.name}TableListParams, ${entity.name} } from './data.d';

export async function queryRule(params?: ${entity.name}TableListParams) {
  return request('/api/rule', {
    params,
  });
}

export async function removeRule(params: { key: ${getTypeScriptType(primary.column)}[] }) {
  return request('/api/rule', {
    method: 'POST',
    data: {
      ...params,
      method: 'delete',
    },
  });
}

export async function addRule(params: ${entity.name}) {
  return request('/api/rule', {
    method: 'POST',
    data: {
      ...params,
      method: 'post',
    },
  });
}

export async function updateRule(params: ${entity.name}TableListParams) {
  return request('/api/rule', {
    method: 'POST',
    data: {
      ...params,
      method: 'update',
    },
  });
}
